import { _decorator, Component, EventKeyboard, game, Input, input, KeyCode, Node, Scene } from 'cc';
import { DataComp } from '../Node/DataComp';
const { ccclass, property } = _decorator;

@ccclass('Save')
export class Save extends Component {

    @property(Node)
    target: Node = null;

    start() {
        input.on(Input.EventType.KEY_DOWN, this.keyDown, this);
    }

    protected onDestroy(): void {

    }

    keyDown(key: EventKeyboard) {
        let data = this.target.getComponent(DataComp);
        for (let key in data) {
            console.log(key);
        }
       
    }

    walkNode(target: Node) {

    }
}


